package com.briup.ch10;

/**
 * @author yuxi
 * @version 1.0
 * @date 2025/10/11
 * @Description:
 */
public class Test02 {
    public static void main(String[] args){
        Thread t1=new Thread(){
            @Override
            public void run(){
                for (int i = 0; i < 100; i++) {
                    System.out.println("自己的线程："+i+Thread.currentThread());
                }
            }
        };
        t1.setName("Thread-1");
        t1.start();
        new Thread("t2"){
            @Override
            public void run(){
                System.out.println("hello");
                System.out.println(Thread.currentThread());
            }
        }.start();
        //Thread t3=()->{};

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName());

    }

}
